package com.liyiruo.tx.service.main7;

import com.liyiruo.tx.mapper.TableAMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 结果就是a1，b1和b2都不会存储到数据库
 *
 * @author liyiruo
 * @Description
 * @Date 2022/2/18 下午5:11
 */
@Service
public class TestMain7 {

    @Autowired
    private TableAMapper tableAMapper;
    @Autowired
    private TestBe testBe7;

    @Transactional(propagation = Propagation.REQUIRED)
    public void testMain() {
        tableAMapper.addTableA();  //调用A入参a1
        testBe7.testB();    //调用testB
    }
}
